/*
 * Window.h
 *
 *  Created on: 11.12.2011
 *      Author: serafim
 */

#ifndef WINDOW_H_
#define WINDOW_H_

#include <iostream>
using std::string;
using std::cin;
using std::cout;
using std::endl;

#include <gtkmm.h>
#define UI_FILE "ui/app.glade"

class Window {
public:
	Window();
	~Window();
	void init(int argc, char* argv[]);

	void setProgressText(string text){_progress->set_text(text);}
	void setProgressPos(double pos);
	void setStatusMessage(string text){_statusbar->push(text);}
	void redrawProgress(){_window->queue_draw();}
	void setRunInactive(){_run_button->set_sensitive(0);}
	void setRunActive(){_run_button->set_sensitive(1);}

	string getKeyword(){return _keyword_field->get_text();}
	int getNum(){return _num_field->get_digits();}
	void update();

private:
	void onRunButtonClicked();
	void onButton1Clicked();
	//Glib::RefPtr<Gtk::Builder> builder;
	Gtk::Window* _window;
	Gtk::Entry* _keyword_field;
	Gtk::SpinButton* _num_field;
	Gtk::Statusbar* _statusbar;

	Gtk::Button* _run_button;
	Gtk::Button* _button1;
	Gtk::ProgressBar* _progress;

};

#endif /* WINDOW_H_ */
